<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
    <style>
      div {
        width: 300px;
        height: 300px;
        border: 1px solid #bfa;
      }
    </style>
  </head>
  <body>
    <button>jq-jsonp</button>
    <div></div>
    <script>
      $('button').click(() => {
        $.getJSON('http://127.0.0.1:9527/jquery-jsonp?callback=?', (res) => {
          if (res.code === 200) {
            $('div').html(
              `name: ${res.data.name},
              <br>
              age: ${res.data.age}
              `
            )
          }
        })
      })
    </script>
  </body>
</html>
